//
package financedata.historicalquotes;

import java.util.Calendar;

public class HistoryRequestProvider {
    
    public enum RequestSourceType {
        QUANDOL_GOOGLE,
        YAHOO_FINANCE,
        YUANMEI_FINANCE,
        MONEY163_FINANCE,
    };

    public static IHistoryRequest createHisReq(String symbol, Calendar from,
            Calendar to, Interval interval, RequestSourceType resType) {

        IHistoryRequest res = null;
        switch (resType) {
            case QUANDOL_GOOGLE:
                res = new QuandlGoogleRequest(symbol, from, to, interval);
                break;

            case YAHOO_FINANCE:
                res = new YahooRequest(symbol, from, to, interval);
                break;

            case YUANMEI_FINANCE:
                res = new YuanMeiRequest(symbol, from, to, interval);
                break;

            case MONEY163_FINANCE:
                res = new Money163Request(symbol, from, to, interval);
                break;
        }

        return res;
    }

}
